package com.superquan.selfstudybootmybatis.utils.httpapply;




import net.sf.json.JSONObject;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zwq
 * @description 用于测试HttpPost请求
 * @date 2022/4/14
 */
public class HttpTest {
    public static void main(String[] args) throws Exception {
        Map<String, Object> paramsMap = new HashMap<>();
        paramsMap.put("userName","10086");
        paramsMap.put("password","123456");
        String jsonStrParams = JSONObject.fromObject(paramsMap).toString();
        String url="http://www.baidu.com";
        String responseStr="";
        if(url!=null && url.toLowerCase().startsWith("https")){
//            responseStr = HttpsUtil.doPost(url, jsonStrParams);
        }else{
//            responseStr = HttpUtil.doPost(url,jsonStrParams);
        }
        System.out.println(responseStr);
    }
}
